/*
  June 2012

  BaseFlightPlus Rev -

  An Open Source STM32 Based Multicopter

  Includes code and/or ideas from:

  1)AeroQuad
  2)BaseFlight
  3)CH Robotics
  4)MultiWii
  5)S.O.H. Madgwick

  Designed to run on Naze32 Flight Control Board

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "stm32f10x.h"
#include "math.h"
#include "board_types.h"
#include "board_timer.h"
#include "board_i2c.h"
///////////////////////////////////////////////////////////////////////////////
// ADXL345 Variables
///////////////////////////////////////////////////////////////////////////////

extern uint8_t accelCalibrating;

extern float accelRTBias[3];

extern int32_t accelSum100Hz[3];

extern int32_t accelSum200Hz[3];

extern int32_t accelSummedSamples100Hz[3];

extern int32_t accelSummedSamples200Hz[3];

extern int16andUint8_t rawAccel[3];

///////////////////////////////////////////////////////////////////////////////
// Read Accel
///////////////////////////////////////////////////////////////////////////////

void readAccel(void);

///////////////////////////////////////////////////////////////////////////////
// Compute Accel Runtime Bias
///////////////////////////////////////////////////////////////////////////////

void computeAccelRTBias(void);

///////////////////////////////////////////////////////////////////////////////
// Accel Initialization
///////////////////////////////////////////////////////////////////////////////

void initAccel(void);

///////////////////////////////////////////////////////////////////////////////
